﻿@using System.Globalization
@model CultuRAM.Models.Session

@{
    ViewBag.Title = "Editar Sessão";
    var propId = Model.SessionId;
    var plac = ViewBag.Places;
}

<h4>Editar Sessão</h4>
<br />
@using (Ajax.BeginForm("EditPv", "Session", new AjaxOptions
{
    UpdateTargetId = "tabEventSesRight",
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "POST",
    OnSuccess = "UpdateEventSes(" + @Model.EventId + ")"
}))
{
    @*@Html.ValidationSummary(false)*@

    <fieldset>
        <legend>Sessão</legend>
        
        @Html.HiddenFor(model => model.SessionId)
        @Html.HiddenFor(model => model.EventId, new { id = "EventId" }) @*//NAO ALTERAR*@
        
        

        <div class="control-group">
            @Html.LabelFor(model => model.Title)     
            <div class="controls">
                @Html.TextBoxFor(model => model.Title, null, new {@style = "width: 510px !important;" })
                @*@Html.ValidationMessageFor(model => model.Title)*@
            </div>
        </div>
       

        <div class="row-fluid">
            
            <div class="span4">
                <div class="control-group">
                    @Html.LabelFor(model => model.Date) 
                    <div id="datetimepickerSes" class="controls input-append date">
                        @Html.TextBoxFor(model => model.Date, new { @Value = Model.Date.ToString("dd/MM/yyyy HH:mm", CultureInfo.InvariantCulture), @style = "width: 115px;" })
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
                        </span>
                        @* @Html.ValidationMessageFor(model => model.Date)*@
                    </div>
                </div>
            </div>

            <div class="span4">
                <div class="control-group">
                    @Html.LabelFor(model => model.Duration)
                
                    <div class="controls">
                        @Html.TextBoxFor(model => model.Duration, null, new {@class="input-small"})
                        @*@Html.ValidationMessageFor(model => model.Duration)*@
                    </div>
                </div>
            </div>

            <div class="span4">
                <div class="control-group">
                    @Html.LabelFor(model => model.Price)
                    <div class="controls">
                        @Html.TextBoxFor(model => model.Price, null, new {@class="input-small"})
                        @*@Html.ValidationMessageFor(model => model.Price)*@
                    </div>
                </div>
            </div>

        </div>
        <div class="control-group">
            @Html.LabelFor(model => model.Place)
            <div class="controls">
                @Html.DropDownListFor(model => model.PlaceId, (SelectList)ViewBag.Places, "- Selecione -", new { id = "PlaceId", @style = "width: 320px !important;"})
                @*@Html.HiddenFor(model => model.Place.PlaceId)*@
                @*@Html.ValidationMessageFor(model => model.Place.PlaceId)*@
                @*@Html.DropDownListFor(model => model.EventTypeId, (SelectList)ViewBag.EventTypeIdDdl, "- Selecione -", new { id = "EventTypeId" })*@
                
            </div>
        </div>
        
        <p>
            @*<input type="submit" value="Guardar" class="btn btn-primary"/>*@
            <button  type="submit" value="Guardar" class="btn btn-primary"><i class="icon-ok icon-white"></i> Guardar</button>
        @Html.Raw(@Ajax.ActionLink("replacetxt", "Default", null, new AjaxOptions()
            {
                UpdateTargetId = "tabEventSesRight",
                InsertionMode = InsertionMode.Replace,
                OnSuccess = "SesBgColorClear()",
            }, new { @class = "btn btn-default" })
		        .ToHtmlString().Replace("replacetxt", "<i class=\"icon-ban-circle\"></i> Cancelar"))

        </p>
    </fieldset>
}



@Scripts.Render("~/bundles/culturam")


